home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 388_01 / ae / 93 / jul / data.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-06  |  3.5 KB  |  129 lines

  1. /*
  2.  * data.c        
  3.  *
  4.  * Anthony's Editor July 93
  5.  *
  6.  * Copyright 1993, 1993 by Anthony Howe.  All rights reserved.  No warranty.
  7.  */
  8.  
  9. #include "header.h"
  10. #include "key.h"
  11.  
  12. int done;
  13. int modified; 
  14. int modeless;
  15.  
  16. t_point point; 
  17. t_point page; 
  18. t_point epage;
  19. t_point marker = NOMARK;
  20.  
  21. int row, col;
  22. int textline = HELPLINE;
  23.  
  24. t_char *buf;
  25. t_char *ebuf;
  26. t_char *gap;
  27. t_char *egap;
  28.  
  29. t_point nscrap;
  30. t_char *scrap;
  31.  
  32. int count;
  33. int input;
  34. int msgflag;
  35. char msgline[BUFSIZ];
  36. char filename[BUFSIZ];
  37. char temp[BUFSIZ];
  38. char *prog_name;
  39.  
  40. t_keytable table[] = {
  41.     { K_CURSOR_LEFT, left, dispcursor },
  42.     { K_CURSOR_RIGHT, right, dispcursor },
  43.     { K_CURSOR_DOWN, down, dispcursor },
  44.     { K_CURSOR_UP, up, dispcursor },
  45.     { K_WORD_LEFT, wleft, dispcursor },
  46.     { K_WORD_RIGHT, wright, dispcursor },
  47.     { K_PAGE_UP, pgup, dispfull },
  48.     { K_PAGE_DOWN, pgdown, dispfull },
  49.     { K_LINE_LEFT, lnbegin, dispcursor },
  50.     { K_LINE_RIGHT, lnend, dispcursor },
  51.     { K_FILE_TOP, top, dispfull },
  52.     { K_FILE_BOTTOM, bottom, dispfull },
  53.     { K_FLIP_CASE, flipcase, dispfull },
  54.     { K_DELETE_LEFT, backsp, dispfull },
  55.     { K_DELETE_RIGHT, delete, dispfull },
  56.     { K_INSERT_ENTER, insert_mode, dispfull },
  57.     { K_LITERAL, insert, dispfull },
  58.     { K_BLOCK, block, dispfull },
  59.     { K_CUT, cut, dispfull },
  60.     { K_PASTE, paste, dispfull },
  61.     { K_UNDO, undo, dispfull },
  62.     { K_FILE_READ, readfile, dispfull },
  63.     { K_FILE_WRITE, writefile, dispfull },
  64.     { K_REDRAW, redraw, dispfull },
  65.     { K_HELP, help, NULL },
  66.     { K_QUIT, quit, NULL },
  67.     { K_QUIT_ASK, quit_ask, NULL },
  68.     { K_SHOW_VERSION, version, dispfull },
  69.     { K_MACRO, macro, dispfull },
  70.     { 0, NULL, dispfull }
  71. };
  72.  
  73. t_keymap key_mode[] = {
  74.     { K_INSERT_EXIT, NULL },
  75.     { K_STTY_ERASE, NULL },
  76.     { K_LITERAL, NULL },
  77.     { K_ERROR, NULL }
  78. };
  79.  
  80. t_keymap *key_map;
  81.  
  82. t_msg m_version = VERSION;
  83. t_msg m_help = "1:";
  84.  
  85. t_msg f_ok = "2:%s: Terminated successfully.\n";
  86. t_msg f_error = "3:%s: Unspecified error.\n";
  87. t_msg f_usage = "4:usage: %s [-f <config>] [file]\n";
  88. t_msg f_initscr = "5:%s: Failed to initialize the screen.\n";
  89. t_msg f_config = "6:%s: Problem with configuration file.\n";
  90. t_msg f_alloc = "7:%s: Failed to allocate required memory.\n";
  91.  
  92. t_msg m_ok = "8:Ok.";
  93. t_msg m_error = "9:An error occured.";
  94. t_msg m_alloc = "10:No more memory available.";
  95. t_msg m_toobig = "11:File \"%s\" is too big to load.";
  96. t_msg m_scrap = "12:Scrap is empty.  Nothing to paste.";
  97. t_msg m_stat = "13:Failed to find file \"%s\".";
  98. t_msg m_open = "14:Failed to open file \"%s\".";
  99. t_msg m_close = "15:Failed to close file \"%s\".";
  100. t_msg m_read = "16:Failed to read file \"%s\".";
  101. t_msg m_write = "17:Failed to write file \"%s\".";
  102. t_msg m_badname = "18:Not a portable POSIX file name.";
  103. t_msg m_file = "19:File \"%s\" %ld bytes.";
  104. t_msg m_saved = "20:File \"%s\" %ld bytes saved.";
  105. t_msg m_loaded = "21:File \"%s\" %ld bytes read.";
  106. t_msg m_modified = "22:File \"%s\" modified.";
  107. t_msg m_badescape = "23:Invalid control character or \\number not 0..255.";
  108. t_msg m_nomacro = "24:No such macro defined.";
  109. t_msg m_slots = "25:No more macro space.";
  110. t_msg m_interrupt = "26:Interrupt.";
  111. t_msg m_eof = "27:<< EOF >>";
  112.  
  113. t_msg p_macro = "28:Macro :";
  114. t_msg p_notsaved = "29:File not saved.  Quit (y/n) ?"; 
  115. t_msg p_press = "30:[ Press a key to continue. ]";
  116. t_msg p_read = "31:Read file :";
  117. t_msg p_write = "32:Write file :";
  118. t_msg p_bwrite = "33:Write block :";
  119. t_msg p_more = "34: more ";
  120. t_msg p_yes = "35: y\b";
  121. t_msg p_no = "36: n\b";
  122. t_msg p_quit = "37: q\b";
  123.  
  124. t_msg m_undo = "38:Nothing to undo.";
  125.  
  126. t_msg message[39];
  127.  
  128. /* end */
  129.